package com.v1.video.headline.zerodelivery;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.v1.video.util.Helper;
import com.v1.video.util.Logger;

public class ZeroIntentReceiver extends BroadcastReceiver{

    public final String TAG = "ZeroIntentReceiver";
    public static final String Broad_Action = "android.net.conn.CONNECTIVITY_CHANGE";//网络状态改变广播
    @Override
    public void onReceive(Context context, Intent intent) {
        // TODO Auto-generated method stub
//        Logger.i(TAG, "网络发生变化 了哦");
    	
        if(!Helper.checkConnection(context)){
//            Logger.i(TAG, "网络发生变化 _关网了");
            return;
        }else{
            Logger.i(TAG, "网络发生变化 _开网了");
            Intent service = new Intent();
            service.setAction(Broad_Action);
         	context.startService(service);  
        }

    }

}